/**
 * Author : duchuynh
 * Nov 14, 2011
 */
package wte.rnd.buildingontology.core;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class FileImportProcess {

	/**
	 * Nov 14, 2011
	 * Author : duchuynh
	 * @param args
	 * @throws IOException 
	 */
	public static ArrayList<String> getListIndividualFormFile(String path) throws IOException{
		ArrayList<String> list = new ArrayList<String>();
		FileInputStream fstream;
		try {
			fstream = new FileInputStream(path);
			DataInputStream in = new DataInputStream(fstream);
			BufferedReader br = new BufferedReader(new InputStreamReader(in));
			String line;								
			while(null != (line = br.readLine())){
				if(!line.equals("")){
					list.add(line);
				}				
			}
		} catch (FileNotFoundException e) {			
			e.printStackTrace();
		}
		return list;
	}
	public static void main(String[] args) throws Exception {
		ArrayList<String> list = FileImportProcess.getListIndividualFormFile("/home/duchuynh/workspace/Crawler/San_Pham/Camera/May_Anh_Ky_Thuat_So/Samsung.txt");
		for (String string : list) {
			System.out.println(string);
		}
	}

}

